﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.AspNet.SignalR;

namespace ERPStore.Diagnostics.Services
{
	public class DiagnosticConnection : PersistentConnection , ERPStore.Services.IPersistentConnection
	{
		protected override bool AuthorizeRequest(IRequest request)
		{
			var apiKey = request.Headers["apikey"];
			return GlobalConfiguration.Configuration.Settings.ApiToken.Equals(apiKey);
		}

		public string Url
		{
			get
			{
				return "diagnostic";
			}
		}
	}
}
